README_Spatial_Mismatch.txt
Job Displacement and the Duration of Joblessness: The Role of Spatial Mismatch
Submission to Review of Economics and Statistics (MS 17338) April 2017

Overall description:

This research was authorized as an internal project at the U.S. Census Bureau to enhance the LEHD Infrastructure Files. 
The data used in this paper are restricted-use data available to researchers with approved projects in secure 
Federal Statistical Research Data Centers (FSRDC). The data and code for this project may be requested by submitting
proposals to the FSRDC network. For more information on this process, see https://www.census.gov/ces/rdcresearch/ (accessed April 13, 2017). 

The confidential files used in this project include the following:
LEHD Infrastructure Files s2008 Snapshot (EHF, PHF_B, ECF, SPF, CPR)
https://www2.census.gov/ces/wp/2011/CES-WP-11-43.pdf
Inputs to LEHD Origin-Destination Employment Statistics, or LODES (WHATB)
2000 Census long form (SCEF)
2000 Census short form (HCEF)

This research used data requested from and provided by Metropolitan Planning Organizations (MPO). These files, 
described in data_notes_mpo.txt are also available with access to the confidential project space at the FSRDCS, but agreements with the
MPOs do not allow for further dissemination of these files.

This research also uses non-confidential data including the following:
2000 Census Summary File 3 (SF3): obtained via DataFerret 2011 Aug. 11
LEHD Origin-Destination Employment Statistics: Origin-Destination File "JT03" for Private Primary Jobs in 2005 (LODES: od_us_2005_jt03_s000_1)
https://lehd.ces.census.gov/data/lodes/LODES7/LODESTechDoc7.0.pdf
2000 Census Transportation Planning Products (CTPP 2000 Part 3)
- See data_notes_ctpp.txt

******************** Data Processing ********************
Files on the server are organized as follows (for the Control_11 vintage):

Project space
 |
 |-Programs (SAS and Stata code)
 |  |
 |  \-Vintages-Control_11 (execution space)
 |
 \-Data (.sas7bdat, .csv, outputs)
    |
    |-Vintages-Control_11 (outputs space)
    \-Input_Data (inputs space)
       |
       |-Attrib (SF3, WHATB, LODES)
       |-CTPP_PU (CTPP)
       |-Geo (Geographic definitions)
       \-Proximity (MPO travel time files)

  -LEHD Snapshot (s2008)
  -CPR
  -SCEF, HCEF
Data preparation and estimation occurred in two codebases on the Research2 server at the U.S. Census Bureau. The server operates Linux version 2.6.32-642.15.1.el6.x86_64. First, SAS (9.2) was used to construct a database from the confidential microdata, with a person/displacement level output file lostjob_analysis.csv. Stata (SE 14.0) loads the .csv and is used for almost all summary statistics and model estimates. The sections below describe both the SAS and Stata processing. The file DataDictionary.pdf provides a listing of the variables, labels, values and sources for the estimation dataset.

***************************** SAS ***************************
The following .sas files must be assembled in the programs directory.

Executables:
control_jobaccess.sas

Modules:
lostjob.sas
modechoice.sas
census2000.sas
measure_access.sas

Three modules provide tables for the paper.
lostjob.sas provides Table D1 (see macro lostjob_run4)
modechoice.sas provides Tables B1, B2, and B3 (see macro modechoice_est)
measure_access.sas provides Table C1 (see macro us_access)

***************************** Stata **************************
The following Stata .do files must be assembles in the programs directory.

Executables:
mismatch_58_run_summary.do
mismatch_58_run_main_e00.do
mismatch_58_run_main_e75.do
mismatch_58_run_main_e90.do
mismatch_58_run_app_e00.do
mismatch_58_run_app_e75.do
mismatch_58_run_app_e90.do

Modules:
path.do
mismatch_58_setup.do
mismatch_58_summary.do
mismatch_58_programs.do
mismatch_58_estimate.do
mismatch_58_appendix.do
pcorrmat.do (see http://econpapers.repec.org/software/bocbocode/s456800.htm)

- mismatch_58_run_summary.do
Description: Execute summary statistics
Runs: path.do, mismatch_58_setup.do, mismatch_58_summary.do
Produces mismatch_58_run_summary.log, which contains summary statistics used on most tables and figures, as described for mismatch_58_summary.do.

- mismatch_58_run_main_e00.do
Description: Execute main estimates where outcome variable is an indicator for obtaining any new job (earnings > 0pct of old job, signified by e00)
Runs: path.do, mismatch_58_setup.do, mismatch_58_programs.do, mismatch_58_estimate.do
Produces mismatch_58_run_main_e00.log, which contains magnitude predictions, as described in mismatch_58_programs.do
Produces 58_run_main_e00_earndom_00_feas_10.xls, which contains parameter estimates as described in mismatch_58_estimate.do

- mismatch_58_run_main_e75.do
Description: Execute main estimates where outcome variable is an indicator for obtaining any new job (earnings > 75pct of old job, signified by e75)
Runs: path.do, mismatch_58_setup.do, mismatch_58_programs.do, mismatch_58_estimate.do
Produces mismatch_58_run_main_e75.log, which contains magnitude predictions, as described in mismatch_58_programs.do
Produces 58_run_main_e75_earndom_75_feas_10.xls, which contains parameter estimates as described in mismatch_58_estimate.do

- mismatch_58_run_main_e90.do
Description: Execute main estimates where outcome variable is an indicator for obtaining any new job (earnings > 90pct of old job, signified by e90)
Runs: path.do, mismatch_58_setup.do, mismatch_58_programs.do, mismatch_58_estimate.do
Produces mismatch_58_run_main_e90.log, which contains magnitude predictions, as described in mismatch_58_programs.do
Produces 58_run_main_e90_earndom_90_feas_10.xls, which contains parameter estimates as described in mismatch_58_estimate.do

- mismatch_58_run_app_e00.do
Description: Execute appendix estimates where outcome variable is an indicator for obtaining any new job (earnings > 0pct of old job, signified by e00)
Runs: path.do, mismatch_58_setup.do, mismatch_58_programs.do, mismatch_58_appendix.do
Produces 58_run_app_e00_earndom_00_feas_10.xls, which contains parameter estimates as described in mismatch_58_appendix.do

- mismatch_58_run_app_e75.do
Description: Execute appendix estimates where outcome variable is an indicator for obtaining any new job (earnings > 75pct of old job, signified by e75)
Runs: path.do, mismatch_58_setup.do, mismatch_58_programs.do, mismatch_58_appendix.do
Produces 58_run_app_e75_earndom_75_feas_10.xls, which contains parameter estimates as described in mismatch_58_appendix.do

- mismatch_58_run_app_e90.do
Description: Execute appendix estimates where outcome variable is an indicator for obtaining any new job (earnings > 90pct of old job, signified by e90)
Runs: path.do, mismatch_58_setup.do, mismatch_58_programs.do, mismatch_58_appendix.do
Produces 58_run_app_e90_earndom_90_feas_10.xls, which contains parameter estimates as described in mismatch_58_appendix.do

- path.do
Description: set directory paths for programs (progdir) and data (datadir)

- mismatch_58_setup.do
Description: Loads lostjob_analysis.csv (see above) into Stata memory and defines variables for summary statistics and estimation

- mismatch_58_summary.do
Description: Calculates summary statistics for Tables 1, 2, D2, F1 and for Figure D1. See code for notes on where each Table/Column is calculated. Where not noted, Table rows correspond with the sequence of calculated statistics.

- mismatch_58_programs.do
Description: Calculates magnitudes of effects (Tables E2 and F3) by predicting quarterly job finding rates by percentiles of job accessibility.

- mismatch_58_estimate.do
Description: For a specified job finding outcome variable (see run programs), module estimates specifications presented in the main text of the paper as well as some appendix items. See code for notes on where results for Tables 3, 4, 5, E1, E2, and F3 are estimated. The same estimates from Tables 1 and 4 are used in the construction of Figure 1.

- mismatch_58_appendix.do
Description: For a specified job finding outcome variable (see run programs), module estimates specifications presented in the appendix text of the paper. See code for notes on where results for Table F2 are estimated.

- pcorrmat.do
Description: used in mismatch_58_summary.do
(see http://econpapers.repec.org/software/bocbocode/s456800.htm)

